/**
 * Created by clakeboy on 16/6/17.
 */

var ip = require('ip');
const ip_address = ip.address();
var webpackConfig = require('./webpack.config');
var webpack = require('webpack');
webpackConfig.entry = [
    // index : './src/app.jsx'
    //资源服务器地址
    'webpack-dev-server/client?http://'+ip_address+':8080',
    'webpack/hot/only-dev-server',
    './src/app.jsx'
];

webpackConfig.plugins = [
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin(),
    new webpack.DefinePlugin({
        'process.env.NODE_ENV': '"development"'
    })
];

// webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
// webpackConfig.plugins.push(
//     new webpack.DefinePlugin({
//         'process.env.NODE_ENV': '"development"'
//     })
// );

webpackConfig.devServer = {
    historyApiFallback: true,
    hot: true,
    inline: true,
    progress: true,
    colors:true
};

webpackConfig.devtool = 'eval-source-map';

module.exports = webpackConfig;
//
// module.exports = webpackConfig.fromCwd().merge({
//     devServer: {
//         historyApiFallback: true,
//         hot: true,
//         inline: true,
//         progress: true
//     },
//     devtool: 'eval-source-map'
// });
